
project(TcpServer LANGUAGES CXX)

file(GLOB SRC_FILES "*.cpp" "*.c")

add_subdirectory(AsyncLogger)

add_library(TcpServer OBJECT ${SRC_FILES})

target_include_directories(TcpServer PUBLIC
    ${CMAKE_SOURCE_DIR}/libevent/include
    ${CMAKE_SOURCE_DIR}/libevent
    ${CMAKE_CURRENT_SOURCE_DIR}/AsyncLogger
    "./"
)

target_link_libraries(TcpServer PUBLIC
    event_extra
    event_core
    AsyncLogger-static
)

if(WIN32)
    target_link_libraries(TcpServer PUBLIC ws2_32)
else()
    target_link_libraries(TcpServer PUBLIC pthread)
endif()

